package 算法回顾;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * @author : K k
 * @date : 21:38 2020/9/6
 */
public class demo4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list=new ArrayList<>();
        for (int i=0;i<n;i++){
            list.add(sc.nextInt());
        }
        int tmp=0;
        for (int i=0;i<list.size();i++){
            System.out.println(findInt(0,list));
        }

    }

    public static int findInt(int i, List<Integer> list){
        int temp=0;
        int ans=0;
        for (int j=0;i<list.size();j++ ){
            if (j==i){
                continue;
            }
            temp=list.get(j);
            if (j+1<list.size() && temp<list.get(j+1)){
                temp=list.get(j+1);
            }
        }
        return 1;

    }
}
